//
//  HLBaseViewController.h
//  s.
//
//  Created by pro on 2021/1/15.
//  Copyright © 2021 hailuo. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "LNavigationBar.h"
#import "JYGlobalEnum.h"
#import "BEEmptyTipView.h"

NS_ASSUME_NONNULL_BEGIN

typedef NSString * __nullable (^ JYEmptyClassStringBlock) (void);

@interface BaseViewController : UIViewController

@property (nonatomic, strong) CBPeripheral * peripheral;


+ (instancetype)newCtl:(id)info;
/** handle回调  */
@property (copy, nonatomic) id handle;

/** 处理事件能力  */
- (void)handleCommand:(NSDictionary *)action;
- (void)handleCommand:(NSDictionary *)action handle:(id __nullable)handle;

#pragma mark - 统一title风格
- (void)setNavTitle:(NSString *)title;
#pragma mark - 全局的返回按钮
- (void)initBackBarItem:(NSString *)title;
- (void)blackBacker;
#pragma mark - 全局的右上角按钮
-(void)initRightBarButtonItemWithButtonIcon:(id)buttonIcon block:(void(^)(UIButton *rightButton))RightButtonBlock;

#pragma mark - 返回按钮点击事件
- (void)popViewController;
- (void)back;
- (void)backWithAnimated:(BOOL)animated;
- (void)backWithAnimated:(BOOL)animated completion: (void (^ _Nullable)(void))completion;
 
#pragma mark - 移除当前视图
-(void)removeSelfContrller;

@property (copy, nonatomic) void (^refreshViewBlock)(void);

@property (assign, nonatomic) BOOL showNoContent;
@property (assign, nonatomic) BOOL showPageLoding;

/// 数据空见面
@property (copy, nonatomic) JYEmptyClassStringBlock emptyClsBlock;
/// 无内容图片
@property (readonly, nonatomic) NSString *empty_image;
/// 空界面 点击action
@property (readonly, nonatomic, nullable) NSDictionary *empty_action;
/// 整体emptyView的位置布局
@property (copy, nonatomic, nullable) JYMakerBlock emptyViewBlock;
///  empty中图片的位置布局
@property (copy, nonatomic, nullable) JYMakerBlock emptyImageBlock;
/// 子类获取empty对象
//@property (readonly, nonatomic) BEEmptyTipView *emptyV;
/// 是否有数据
@property (assign, nonatomic) BOOL jy_haveData;


/// 是否显示导航栏下方的线（自定义的）默认NO
@property (assign, nonatomic, readonly) BOOL showLine;


/// 系统导航隐藏 默认隐藏
@property (assign, nonatomic, readonly) BOOL bar_hidden;


/// 设置自定义导航的标题
@property (strong, nonatomic) NSString *jy_title;
/// 隐藏自定义导航 默认不隐藏
@property (assign, nonatomic, readonly) BOOL jy_bar_hidden;
/// 自定义导航的高度
@property (assign, nonatomic, readonly) CGFloat jy_bar_h;
///
@property (weak, nonatomic, readonly) LNavigationBar *bar;
/// 自定义导航 右侧按钮
@property (weak, nonatomic) UIButton *rightBtn;

/// 侧滑手势，默认YES
@property (assign, nonatomic) BOOL popGestureEnabled;


/// 是否第一次加载controller
- (BOOL)isFirstLoad;

/// 设置系统导航背景色
- (void)setNavigationBarColor:(UIColor *)color;

/// 删除当前控制前之前的count个控制器
- (void)removeTopVcCount:(NSInteger)count;

/// 删除当前控制器之前的控制器直到vcName
- (void)removeTopVcUntil:(NSString *)vcName;
@end

NS_ASSUME_NONNULL_END
